<?php include _include(ADMIN_PATH.'view/htm/header.inc.htm');?>

<div class="row">
	<div class="col-xs-12">
		<div class="btn-group m-b-1" role="group">
			<?php echo admin_tab_active($menu['transfer']['tab'], 'setting');?>
		</div>
	</div>
</div>

<div class="row">
	<div class="col-lg-12">
		<div class="card">
			<div class="table-responsive">
				<form action="<?php echo url('transfer-setting');?>" method="POST">
					<table class="table" style="min-width: 800px">
						<thead>
							<tr>
								<th class="text-center">通道名称</th>
								<th class="text-center">累积收款金额</th>
								<th class="text-center">实时剩余金额</th>
								<th class="text-center">触发转账金额</th>
                              	<th class="text-center">转账金额</th>
								<th class="text-center">支付宝转账账号</th>
							</tr>
						</thead>
						<tbody id="userlist">
							<?php if($channel){foreach($channel as $l){ ?>
							<tr uid="<?php echo $l['id']; ?>">
								<td class="text-center"><?php echo $l['name'];?></td>
								<td class="text-center"><input class="form-control" name="money_total[<?php echo $l['id'];?>]" value="<?php echo $l['money_total'];?>"></td>
								<td class="text-center"><?php echo $l['money'];?></td>
								<td class="text-center"><input class="form-control" name="money_level[<?php echo $l['id'];?>]" value="<?php echo $l['money_level'];?>"></td>
								<td class="text-center"><input class="form-control" name="money_trans[<?php echo $l['id']; ?>]" value="<?php echo $l['money_trans']; ?>"></th>
								<td class="text-center"><input class="form-control" name="transto[<?php echo $l['id']; ?>]" value="<?php echo $l['transto']; ?>"></th>
                  			</tr>
							<?php }} ?>
						</tbody>
					</table>
					<div class="row" style="margin:5px 10px;">
						<div class="col-lg-2">
							<div class="form-group">
								<input type="checkbox" name="clear_money_total" id="clear_money_total" value="1"><label for="clear_money_total">清0累积收款金额</label>
							</div>
						</div>
						<div class="col-lg-2">
							<div class="form-group">
								<input type="password" class="form-control" name="passcode" value="" placeholder="输入安全码">
							</div>
						</div>
						<div class="col-lg-2">
							<div class="form-group">
								<button class="btn btn-primary" id="submit">提交修改</butotn>
							</div>
						</div>
					</div>
				</form>
			</div>
			<hr class="m-t-0" />
		</div>
		<nav class="text-center"><ul class="pagination"><?php echo $pagination; ?></ul></nav>
	</div>
</div>

<?php include _include(ADMIN_PATH.'view/htm/footer.inc.htm');?>

<script>

var jform = $('form');
$('#submit').click(function(){
	var postdata = jform.serialize();
	$.xpost(jform.attr('action'), postdata, function(code, message){
		$.alert(message);
		if(code==1) setTimeout(function(){window.location.reload()}, 1500);
	});
	return false;
});

$('#nav_pc li.transfer, #nav_mobile li.transfer').tab('show');
</script>